// IFileExtractCallback.h

#ifndef __IFILEEXTRACTCALLBACK_H
#define __IFILEEXTRACTCALLBACK_H


namespace Common
{
namespace Archive
{

  enum class OverwriteAnswer
  {
    kYes,
    kYesToAll,
    kNo,
    kNoToAll,
   // kAutoRename,
    kCancel
  };

}
}

MIDL_INTERFACE("23170F69-40C1-278A-0000-000100070000")
IFolderArchiveExtractCallback: public IProgress
{
public:
  STDMETHOD(AskOverwrite)(
      const wchar_t *existName, const FILETIME *existTime, const UINT64 *existSize,
      const wchar_t *newName, const FILETIME *newTime, const UINT64 *newSize,
      Common::Archive::OverwriteAnswer *answer) PURE;
  STDMETHOD(PrepareOperation)(const wchar_t *name, bool isFolder, INT32 askExtractMode, const UINT64 *position) PURE;
  STDMETHOD(MessageError)(const wchar_t *message) PURE;
  STDMETHOD(SetOperationResult)(INT32 operationResult, bool encrypted) PURE;
};

//This GUID is created by AM (increased 0 -> 1)
MIDL_INTERFACE("23170F69-40C1-278A-0000-000100071000")
IExtractCallbackUI: IFolderArchiveExtractCallback
{
  virtual HRESULT BeforeOpen(const wchar_t *name) = 0;
  virtual HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted) = 0;
  virtual HRESULT ThereAreNoFiles() = 0;
  virtual HRESULT ExtractResult(HRESULT result) = 0;

  #ifndef _NO_CRYPTO
  virtual HRESULT SetPassword(const CString &password) = 0;
  #endif
};

#endif
